<@t.plat_body pageid="plats">
<script type="text/javascript" src="${base}/js/plugins/datatables/datatables.min.js"></script>
<script type="text/javascript" src="${base}/js/plugins/datatables/datatables_basic.js"></script>
<div class="panel panel-flat">
    <div class="panel-heading">
        <h5 class="panel-title">访问渠道</h5>
    </div>

    <table class="table table-striped table-bordered datatable-basic" id="userTable">
    </table>
</div>
<script>
    var table;
    $(function () {
        table=simpleTable('userTable', [
            {
                sWidth:80,
                dataIndex: 'code',
                title: "渠道编号"
            },
            {
                dataIndex: 'name',
                title: "渠道名称"
            },

            {
                sWidth:80,
                dataIndex: 'flag',
                title: "是否启用",
                render:function (data) {
                    return (data=='0')?"否":"是";
                }
            },
                {
                dataIndex: 'payWays',
                title: "支付方式",
                render:function (data) {
                    var names=[],payWays=data;
                    if(payWays && payWays.length>0){
                        for(var i=0;i<payWays.length;i++){
                            names.push(payWays[i].name);
                        }
                    }
                    return names.join(',');
                }
            },
            {
                title: "操作",
                dataIndex: 'code',
//                sClass:'text-center',
                render: function (data, type, full) {
                    var html = '<div>';
                            <#--html+='<a style="margin-left: 2px" onclick="dialogBox(\'${base}/plat/platform/editPlats?code='+data+'\', \'支付设置\', 500, 400);" class="btn btn-success btn-xs btn-outline">支付设置</a>';-->
                            if(data=='003'){
                                html+='<a href="javascript:void(0)" style="margin-left: 2px" onclick="dialogBox(\'${base}/plat/platform/editPlatsWechat?code='+data+'\', \'功能设置\', 700, 500);" class="btn btn-primary btn-xs btn-outline">功能设置</a>'
                            }
                            html+='</div>';
                    return html;
                }
            }
        ], {
            bAutoWidth:false,
            searching: true,
            bLengthChange: false,
            bSort: false,
            url: '${base}/pl/platform/listPlats',
            pageLength: 25

        });
    });
</script>
</@t.plat_body>
